<!-- <template>
  <view class="container">
    <view class="example">
      <uni-forms ref="form" :model="user" labelWidth="80px">
        <uni-forms-item label="用户昵称" name="nickName">
          <uni-easyinput v-model="user.nickName" placeholder="请输入昵称" />
        </uni-forms-item>
        <uni-forms-item label="手机号码" name="phonenumber">
          <uni-easyinput v-model="user.phonenumber" placeholder="请输入手机号码" />
        </uni-forms-item>
        <uni-forms-item label="邮箱" name="email">
          <uni-easyinput v-model="user.email" placeholder="请输入邮箱" />
        </uni-forms-item>
        <uni-forms-item label="性别" name="sex" required>
          <uni-data-checkbox v-model="user.sex" :localdata="sexs" />
        </uni-forms-item>
      </uni-forms>
      <button type="primary" @click="submit">提交</button>
    </view>
  </view>
</template>

<script>
  import { getUserProfile } from "@/api/system/user"
  import { updateUserProfile } from "@/api/system/user"

  export default {
    data() {
      return {
        user: {
          nickName: "",
          phonenumber: "",
          email: "",
          sex: ""
        },
        sexs: [{
          text: '男',
          value: "0"
        }, {
          text: '女',
          value: "1"
        }],
        rules: {
          nickName: {
            rules: [{
              required: true,
              errorMessage: '用户昵称不能为空'
            }]
          },
          phonenumber: {
            rules: [{
              required: true,
              errorMessage: '手机号码不能为空'
            }, {
              pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/,
              errorMessage: '请输入正确的手机号码'
            }]
          },
          email: {
            rules: [{
              required: true,
              errorMessage: '邮箱地址不能为空'
            }, {
              format: 'email',
              errorMessage: '请输入正确的邮箱地址'
            }]
          }
        }
      }
    },
    onLoad() {
      this.getUser()
    },
    onReady() {
      this.$refs.form.setRules(this.rules)
    },
    methods: {
      getUser() {
        getUserProfile().then(response => {
          this.user = response.data
        })
      },
      submit(ref) {
        this.$refs.form.validate().then(res => {
          updateUserProfile(this.user).then(response => {
            this.$modal.msgSuccess("修改成功")
          })
        })
      }
    }
  }
</script>

<style lang="scss">
  page {
    background-color: #ffffff;
  }

  .example {
    padding: 15px;
    background-color: #fff;
  }

  .segmented-control {
    margin-bottom: 15px;
  }

  .button-group {
    margin-top: 15px;
    display: flex;
    justify-content: space-around;
  }

  .form-item {
    display: flex;
    align-items: center;
    flex: 1;
  }

  .button {
    display: flex;
    align-items: center;
    height: 35px;
    line-height: 35px;
    margin-left: 10px;
  }
</style> -->


<template>
	<view>
	
		
		
		<view>
			<uni-segmented-control :current="current" :values="items" styleType="button" activeColor="#ffaa00" @clickItem="onClickItem" style="background-color: #fff"  />
		</view>
		<view>
			<view v-if="current === 0">
		       <view>
				   <uni-card>
					   <uni-row>供应商编号:1000010</uni-row>
					   <uni-row>供应商名称:常州臻霆机电设备有限公司</uni-row>
					   <uni-row>联系人:张三</uni-row>
					   <uni-row>职位:经理</uni-row>
					   <uni-row>电话:0574-5858558</uni-row>
					   <uni-row>传真:0574-5858558</uni-row>
					   <uni-row>手机:1888888888</uni-row>
					   <uni-row>地址:浙江省宁波市北仑区1010号</uni-row>
					   <uni-row>电子邮件:192@122112.com</uni-row>
				       <uni-row>供应商等级:3级</uni-row>
					   <uni-row>供应商评分:80分</uni-row>
					    <uni-row>状态:启用</uni-row>
						<uni-row>采购员:李四</uni-row>
				   </uni-card>
			   </view>
			</view>
			<view v-if="current === 1">
				
			<view>
				 <uni-card>
					 
				<uni-row>统一码:100101010101</uni-row>
				<uni-row>简称:常州臻霆机电设备有限公司</uni-row>
				
				<uni-row>统一码:100101010101</uni-row>
				<uni-row>组织机构代码:100101010101</uni-row>
				<uni-row>认证地区:江苏</uni-row>
				<uni-row>企业类型:中小企业</uni-row>
				<uni-row>纳税人标识:100101010101</uni-row>
				<uni-row>注册地:江苏</uni-row>
				<uni-row>法定代表人:张三</uni-row>
				<uni-row>注册资本:1000万</uni-row>
				<uni-row>注册资本币种:人民币</uni-row>
				<uni-row>经营范围:100101010101</uni-row>
				<uni-row>主要身份:100101010101</uni-row>
				<uni-row>经营性质:100101010101</uni-row>
				<uni-row>行业类型:100101010101</uni-row>
				<uni-row>公司官网:https://www/baidu.com</uni-row>
				<uni-row>主营品类:钢材</uni-row>
				<uni-row>公司简介:100101010101</uni-row>
				 </uni-card>
			</view>
			
			</view>
			<view v-if="current === 2">
			<view>
				 <uni-card>
				<uni-row>
					 <view>营业执照:</view>
					<image src="../../../static/images/banner/banner01.jpg" style="width: 200rpx;height: 200rpx;"></image>
					<image src="../../../static/images/banner/banner01.jpg" style="width: 200rpx;height: 200rpx;"></image>
					<image src="../../../static/images/banner/banner01.jpg" style="width: 200rpx;height: 200rpx;"></image>
				</uni-row>	 
				 </uni-card>
			</view>
			</view>
		</view>
		
			<view>
			<uni-row style="text-align: center;">
				<uni-col :span="24"><button size="mini" type="primary">保存</button></uni-col>
				
			</uni-row>
			</view>
		
	</view>
</template>

<script>
	export default {
		data() {
			return {
				current:0,
				items: ['基本详细', '合法信息', '附件'],
			}
		},
		methods: {
			back(){
				this.$tab.reLaunch('/pages/work/purchaser/purchaser_list_register')
			},
			
			onClickItem(e) {
				if (this.current !== e.currentIndex) {
				this.current = e.currentIndex
					}
						},
		}
	}
</script>

<style>

</style>

